package com.shiikong_memory.yez;

import com.shiikong_memory.yez.VirginGenerator.SaintGeneratedModule;
import love.forte.simbot.component.kook.event.KookChannelMessageEvent;
import love.forte.simbot.kook.api.message.SendChannelMessageApi;
import love.forte.simbot.quantcat.common.annotations.ContentTrim;
import love.forte.simbot.quantcat.common.annotations.Listener;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.concurrent.CompletableFuture;

@Component
public class Menu {
    @Listener
    @ContentTrim
    public CompletableFuture<?> openMenu(KookChannelMessageEvent event){
        boolean MenuBoolean= event.getSourceEvent().getContent().replaceAll(" ", "").matches("^.*菜单$");
        if (MenuBoolean){
            return event.getContent().sendAsync(SendChannelMessageApi.create(10,event.getSourceEvent().getTargetId(), Json));
        }
        return null;
    }


    private static String Json = """
            [
              {
                "type": "card",
                "theme": "secondary",
                "size": "lg",
                "modules": [
                  {
                    "type": "header",
                    "text": {
                      "type": "plain-text",
                      "content": "菜单"
                    }
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "section",
                    "text": {
                      "type": "paragraph",
                      "cols": 2,
                      "fields": [
                        {
                          "type": "kmarkdown",
                          "content": "**指令**\\n"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "**功能**\\n"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "圣女生成: <对象>"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "***异世界转世圣女模拟器***"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "登录鹰角通行证: <Token>"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "***登录鹰角通行证***"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "登录鹰角通行证"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "***登录鹰角通行证（网站自动版）***"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "获取明日方舟数据/获取明日方舟数据B"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "***获取明日方舟数据并展示(需登录鹰角通行证)***"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "获取明日方舟抽卡数据"
                        },
                        {
                          "type": "kmarkdown",
                          "content": "***获取明日方舟抽卡数据并展示(需登录鹰角通行证，目前只支持官方)***"
                        }
                      ]
                    }
                  },
                  {
                    "type": "divider"
                  }
                ]
              }
            ]
            """;
}
